package com.qcby.train.mybaitsplusdemo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qcby.train.mybaitsplusdemo.entity.ClassInfo;
import com.qcby.train.mybaitsplusdemo.entity.Student;
import com.qcby.train.mybaitsplusdemo.mapper.ClassInfoMapper;
import com.qcby.train.mybaitsplusdemo.mapper.StudentMapper;
import com.qcby.train.mybaitsplusdemo.service.IClassInfoService;
import com.qcby.train.mybaitsplusdemo.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @className: StudentServiceImpl
 * @description:
 * @author: lxt
 * @create: 2021-04-26 20:35
 **/
@Service// alt +回车
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements IStudentService {

    @Autowired
    private StudentMapper studentMapper;


    @Override// ctrl + u
    public IPage<Student> listStudentPage(IPage<Student> page,Student student) {
        return page.setRecords(studentMapper.listStudentPage(page,student));
    }


    @Override
    public IPage<Student> listPageNew(Student student, IPage<Student> page) {
        return this.baseMapper.listPageNew(student,page);
    }

    @Override
    public IPage<Student> listPage0521(IPage<Student> page,QueryWrapper<Student> queryWrapper) {
        return page.setRecords(this.baseMapper.listPage0521(page,queryWrapper));
//        return page.setRecords(studentMapper.listPage0521(page));
    }

    @Override
    public IPage<Student> listPage0521(IPage<Student> page, Student student) {
        return page.setRecords(this.baseMapper.listPage052101(page,student));
    }

    @Override
    public IPage<Student> listPage052102(IPage<Student> page, QueryWrapper<Student> queryWrapper) {
        return page.setRecords(this.baseMapper.listPage052102(page,queryWrapper));
    }

    @Override
    public IPage<Student> listPage052103(IPage<Student> page, Student student) {
        return this.baseMapper.listPage052103(student,page);
    }

    @Override
    public Student selectByClassInfoId(Long classInfoId) {
        return this.baseMapper.selectByClassInfoId(classInfoId);
    }


    @Override
    public IPage<Student> listPage(IPage<Student> page, Student student) {

        List<Student> list = this.baseMapper.listPage(student,page);
        return page.setRecords(list);
//        return page.setRecords(studentMapper.listPage(student,page));
    }

    @Override
    public IPage<Student> listPage1(IPage<Student> page, Student student) {
        return page.setRecords(this.baseMapper.listPage1(page,student));
    }

    @Override
    public IPage<Student> listPage2(IPage<Student> page, LambdaQueryWrapper<Student> queryWrapper) {
        return page.setRecords(this.baseMapper.listPage2(page,queryWrapper));
    }

    @Override
    public IPage<Student> listPage3(IPage<Student> page, QueryWrapper<Student> queryWrapper) {
        return page.setRecords(this.baseMapper.listPage3(page,queryWrapper));
    }


}
